package com.bys.generator.util;

import java.util.Optional;
import java.util.Scanner;

public class ScannerUtil {
    private ScannerUtil() {
    }

    public static String scannerIn(String message){
        Scanner scanner = new Scanner(System.in);
        System.out.println(message);
        String result = scanner.nextLine();
        Optional.ofNullable(result).orElseThrow(() -> new RuntimeException("请输入合法的字符串"));
        return result;
    }
}
